import dayjs from 'dayjs'

Page({

  data: {
    problemTitle: "",
    problemText: "",
    createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
    userId: 1
  },
  sendReqeust() {
    console.log(this.data.problemTitle);
    wx.request({
      url: 'http://localhost:8080/consult/problem/add',
      method: "post",
      header: {
        'Content-Type': 'application/json'
      },
      data: JSON.stringify(this.data),
      success:res => {
        console.log(res);
      }
    }),
    wx.navigateTo({
      url: '/pages/index/psychology/qa/qa',
    })
  },
  /**
   * Lifecycle function--Called when page load
   */
  onLoad(options) {

  },

  /**
   * Lifecycle function--Called when page is initially rendered
   */
  onReady() {

  },

  /**
   * Lifecycle function--Called when page show
   */
  onShow() {

  },

  /**
   * Lifecycle function--Called when page hide
   */
  onHide() {

  },

  /**
   * Lifecycle function--Called when page unload
   */
  onUnload() {

  },

  /**
   * Page event handler function--Called when user drop down
   */
  onPullDownRefresh() {

  },

  /**
   * Called when page reach bottom
   */
  onReachBottom() {

  },

  /**
   * Called when user click on the top right corner to share
   */
  onShareAppMessage() {

  }
})